<%--
  Created by IntelliJ IDEA.
  User: 张鹏
  Date: 2022/10/13
  Time: 13:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<!DOCTYPE html>
<html>

<head>
  <title>账户修改</title>
  <link rel="stylesheet" type="text/css" href="./css/bootstrap.min.css">
  <script src="./js/jquery-3.2.1.min.js"></script>
  <script src="./js/bootstrap.min.js"></script>
</head>

<body>
<!-- 顶栏 -->
<jsp:include page="top.jsp"/>

<!-- 中间主体 -->
<jsp:include page="menu.jsp"/>


<div class="col-md-10">
  <div class="container">
    <div class="panel panel-primary">
      <div class="panel-heading">
        <div class="row">
          <h1 style="text-align: center;">修改用户等级</h1>
        </div>
      </div>
      <div class="panel-body">
        <form class="form-horizontal" role="form" action="UserLevelServlet.do?action=addOrEdt" method="post">
          <div class="form-group">
            <label for="uid" class="col-sm-2 control-label">账号</label>
            <div class="col-sm-10">
              <input readonly="readonly" type="text" class="form-control" id="uid"
                     name="uid" value="${userLevel.user.uid}">
            </div>
          </div>
          <div class="form-group">
            <label for="uname" class="col-sm-2 control-label">姓名</label>
            <div class="col-sm-10">
              <input type="text" class="form-control" id="uname" name="uname"
                     placeholder="请输入姓名" value="${userLevel.user.uname}">
            </div>
          </div>
          <div class="form-group">
            <label for="level" class="col-sm-2 control-label">星级</label>
            <div class="col-sm-10">
              <select class="form-control" name="level" id="level"/>
              <option
                      <c:if test="${userLevel.level==null}">selected</c:if> value="">
              </option>
              <option
                      <c:if test="${userLevel.level==0}">selected</c:if> value="0">一星用户
              </option>
              <option
                      <c:if test="${userLevel.level==1}">selected</c:if> value="1">二星用户
              </option>
              <option
                      <c:if test="${userLevel.level==2}">selected</c:if> value="2">三星用户
              </option>
              </select>
            </div>
          </div>


          <div class="form-group">
            <label for="money" class="col-sm-2 control-label">可贷款金额</label>
            <div class="col-sm-10">
              <input readonly="readonly" type="text" class="form-control" id="money"
                     name="money" value="${userLevel.limit}">
            </div>
          </div>


          <div class="form-group" style="text-align: center">
            <button class="btn btn-success" type="submit">提交</button>
            <button class="btn btn-warning" type="reset">重置</button>
          </div>
        </form>
      </div>

    </div>
  </div>
</div>

<script>
  $("#nav a:nth-child(2)").addClass("active");
  var message = "${message}";
  if (message != "") {
    alert(message);
  }
</script>
</body>

</html>
